﻿<cms-modal-dialog-container cms-modal-size="large">

    <cms-modal-dialog-header>
        Vimeo Video
    </cms-modal-dialog-header>

    <cms-form cms-name="videoDetailsForm"
              cms-loading="loadState.isLoading">

        <cms-page-actions>

            <cms-button class="main-cta" cms-text="Ok"
                        ng-click="onOk()"
                        ng-disabled="!model.id"></cms-button>

            <cms-button cms-text="Cancel" ng-click="onCancel()"></cms-button>

        </cms-page-actions>

        <cms-page-body>

            <cms-form-section cms-title="Vimeo video">

                <cms-form-field-vimeo-id cms-model="model.id"
                                            cms-on-video-selected="onVideoSelected(model)"></cms-form-field-vimeo-id>

                <cms-form-field-container cms-title="Preview" class="form-field-vimeo-preview">
                    <cms-vimeo-video cms-model="model"></cms-vimeo-video>
                </cms-form-field-container>

                <cms-form-field-text cms-title="Title"
                                        cms-model="model.title"
                                        cms-disabled="isEditingVideoId"
                                        ng-if="!isModelId"></cms-form-field-text>

                <cms-form-field-text-area cms-title="Description"
                                            cms-model="model.description"
                                            cms-disabled="isEditingVideoId"
                                            ng-if="!isModelId"></cms-form-field-text-area>

                <cms-form-field-readonly cms-title="Title"
                                            cms-model="model.title"
                                            ng-if="isModelId"></cms-form-field-readonly>

                <cms-form-field-readonly cms-title="Description"
                                            cms-model="model.description"
                                            ng-if="isModelId"></cms-form-field-readonly>

            </cms-form-section>

        <cms-page-body>

    </cms-form>

</cms-modal-dialog-container>